home *** CD-ROM | disk | FTP | other *** search
- // $Id: struct.vsl,v 1.2 1995/05/17 13:39:55 zeller Exp $
- // Draw structograms
-
- // Copyright (C) 1993 Technische Universitaet Braunschweig, Germany.
- // Written by Andreas Zeller (zeller@ips.cs.tu-bs.de).
- //
- // This file is part of the NORA Library.
- //
- // The NORA Library is free software; you can redistribute it and/or
- // modify it under the terms of the GNU Library General Public
- // License as published by the Free Software Foundation; either
- // version 2 of the License, or (at your option) any later version.
- //
- // The NORA Library is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- // See the GNU Library General Public License for more details.
- //
- // You should have received a copy of the GNU Library General Public
- // License along with the NORA Library -- see the file COPYING.LIB.
- // If not, write to the Free Software Foundation, Inc.,
- // 675 Mass Ave, Cambridge, MA 02139, USA.
- //
- // NORA is an experimental inference-based software development
- // environment. Contact nora@ips.cs.tu-bs.de for details.
-
- #include "std.vsl"
- #include "tab.vsl"
- #include "slopes.vsl"
-
- // Version
- struct_version() = "$Revision: 1.2 $";
-
- // Struktogramme
-
- // framedListStruct() erzeugt vertikale Liste, durch horizontale Linien getrennt
-
- _framedListStruct(stmt) = stmt;
- _framedListStruct(stmt, ...) =
- _framedListStruct(stmt)
- | hrule()
- | _framedListStruct(...);
-
- framedListStruct(...) =
- vfix(_framedListStruct(...));
-
-
- // topLoopStruct() erzeugt abweisende Schleife
-
- topLoopStruct(cond, body) =
- cond
- | indent(hrule() | vrule() & body);
-
-
- // bottomLoopStruct() die andere (wie war noch der Name?)
-
- bottomLoopStruct(body, cond) =
- indent(vrule() & body | hrule())
- | cond;
-
-
- // topBottomLoopStruct() mit Ein- und Ausgangskontrolle
-
- topBottomLoopStruct(cond1, body, cond2) =
- cond1
- | indent(hrule() | vrule() & body | hrule())
- | cond2;
-
-
- // fallStruct() erzeugt Kasten mit Haelfte links unten/rechts oben
- // riseStruct() erzeugt Kasten mit Haelfte rechts unten/links oben
-
- _fallStruct(sw, ne) =
- fall() ^ sw_flush(sw) ^ ne_flush(ne) ^ (sw + ne + rulethickness())
- | hrule();
- fallStruct(sw, ne) = _fallStruct(sw, ne);
-
- _riseStruct(nw, se) =
- rise() ^ nw_flush(nw) ^ se_flush(se) ^ (nw + se + rulethickness())
- | hrule();
- riseStruct(nw, se) = _riseStruct(nw, se);
-
-
- // testStruct() erzeugt Kasten mit Bedingung, True-Label, False-Label,
- // True-Koerper und False-Koerper
-
- testStruct(cond, leftbody, rightbody, leftlabel, rightlabel) =
-
- let width = hspace(leftlabel | leftbody | rightlabel | rightbody | cond) in
-
- let height = vspace((leftlabel & rightlabel) | cond) in
-
- let ltop = width ^ fall() ^ sw_flush(leftlabel),
- rtop = width ^ rise() ^ se_flush(rightlabel),
- top = ((ltop & rtop) ^ n_flush(cond)) ^ height in
-
- let lbottom = leftbody ^ width,
- rbottom = rightbody ^ width,
- bottom = (lbottom & vrule() & rbottom) in
-
- top | hrule() | bottom;
-